﻿// Bing Maps ASP.NEt Control is a community project available under the Microsoft Public License (Ms-PL)
// Code is provided as is and with no warrenty – Use at your own risk
// View the project and the latest code at http://BingMapsASP.codeplex.com

using System.Collections.Generic;
using System.Web.UI;
using Microsoft.Live.ServerControls.VE.Constants;

[assembly: WebResource("Microsoft.Live.ServerControls.VE.Extenders.Find.js", "text/javascript")]
[assembly: WebResource("Microsoft.Live.ServerControls.VE.Extenders.Find.debug.js", "text/javascript")]

namespace Microsoft.Live.ServerControls.VE.Extenders
{
    [ToolboxData(@"<{0}:Find ID=""FindExtender1"" runat=""server"" MapControlID="""" TargetControlID="""" ></{0}:Find>")]
    public sealed class Find : ToggleExtenderBase
    {

        #region ExtenderControl Members

        protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("Microsoft.Live.ClientControls.VE.Extenders.Find", targetControl.ClientID);
            descriptor.AddProperty(ExtenderControlProperty.ToggleMode, ToggleMode);
            descriptor.AddProperty(ExtenderControlProperty.MapControlID, MapControlID);
            yield return descriptor;
        }

        protected override IEnumerable<ScriptReference> GetScriptReferences()
        {
            List<ScriptReference> descriptors = new List<ScriptReference>();
            descriptors.Add(new ScriptReference("Microsoft.Live.ServerControls.VE.Extenders.Find.js", GetType().Assembly.FullName));
            return descriptors;
        }

        #endregion
    }
}
